<%@ page import="java.util.*" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: zhangyiyi
  Date: 2025/3/3
  Time: 9:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setAttribute("date",new Date());
%>
<fmt:formatDate value="${date}" type="both" dateStyle="default" timeStyle="default" var="date1"/>
显示default日期时间：${date1}<br>
<fmt:formatDate value="${date}" type="both" dateStyle="short" timeStyle="short" var="date2"/>
显示short日期时间：${date2}<br>
<fmt:formatDate value="${date}" type="both" dateStyle="long" timeStyle="long" var="date3"/>
显示long日期时间：${date3}<br>
<fmt:formatDate value="${date}" type="both" dateStyle="long" timeStyle="full" var="date4"/>
显示full日期时间：${date4}<br>
<fmt:formatDate value="${date}" type="both" pattern="yyyy年mm月dd日 HH时mm分ss秒SSS毫秒" var="date5"/>
显示自定义格式日期时间：${date5}<br>
</body>
</html>
